package com.gong.yuanma.spring;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @author GongChang
 * @version 1.0
 * @date 2021/7/5 0005 22:02
 */
public class Test {


    public static void main(String[] args) {
        ApplicationContext applicationContext = new AnnotationConfigApplicationContext(Config.class);
        System.out.println("容器创建完毕");

        Person person = applicationContext.getBean("person", Person.class);

        System.out.println(person.getClass().getName());

        ((AnnotationConfigApplicationContext) applicationContext).close();
    }
}
